home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
By Popular Request 2.0
/
By Popular Request 2.0 (Arsenal Computer).ISO
/
amiga_2
/
cnetjam2.lha
/
CNetJam2
/
cnet
/
pfiles
/
fido
/
BaseSizer
< prev
next >
Wrap
Text File
|
1995-01-27
|
4KB
|
93 lines
/**************************************************************************\
$VER: Fido Base Sizes, v2.0 (27-Jan-95) by Dotoran!
\**************************************************************************/
options results;signal on SYNTAX;signal on ERROR;signal on IOERR
tr=transmit;se=sendstring;gu=getuser;a='rexxsupport.library'
if ~show('l',a) then if ~addlib(a,0,-30) then exit
ff="BASE1:"
/* Change the "ff" variable above to the directory where you store your
networked bases. Recall I use Base1 for ONLY my Fido Echoes. This won't
function correctly if you have other bases in there as well. I mean,
it WILL function, but may look a bit odd with Local Bases mixed in.
You need the "sort" and "delete" commands located somewhere in your
valid PATH assignment, as well as a RAM: assigned. You also need the
"rexxsupport.library" in your LIBS: directory.
This file is also accessable through the NetUtils file located in this
directory as well. You can also add the following line to the bottom of
your Menu # 2; Available Everywhere Menu of your "cnet:bbsmenu" file:
SIZES `1- | {*0base1:BaseSizes}
^
Control-Q
This file should be run at least once a day, but preferably right after
your TOSS finishes importing NEW messages. What I do is to create an
event to run one hour AFTER my polling event. It looks like this:
Command: RunARexx
Args: pfiles:fido/BaseSizes
[port(s)]: 0 (whatever works for you)
Type: Immediate--system idle or not
Days: Check ALL Seven
Time: 900 (I poll at 8, so one hour later)
Valid: 100 (Try to run between 9 and 10)
Interval: 1200 (Run every 12 hours)
Iterate: 2 (twice, so at 9AM and 9PM)
*/
/***** Code Starts Here *****/
f1=showdir(ff,"d");tr "f1Fido Base Sizesn1@4";c=0;b.=""
do i=1 to words(f1);f=word(f1,i);fn="base1:"||f||"/data/"
if ~exists(fn"_Text") then iterate i;tr f;f2=showdir(fn,"f");aa=0
do j=1 to words(f2);z=word(f2,j);a=word(statef(fn||z),2)
tr right(z,12)": "a" bytes.";aa=aa+a
end j;c=c+1;b.c=f""aa"x";tr
end i
call open(f0,"ram:temp","w")
do i=1 to c;call writeln(f0,b.i);end i
call close(f0)
address command "sort ram:temp ram:temp"
call open(f0,"ram:temp","r")
do i=1 to c;b.i=readln(f0);end i
call close(f0)
address command "delete ram:temp"
call open(f1,ff"BaseSizes","w")
call writeln(f1,"f1z6c4"center("FIDO-Net Message Base Sizes",79)"z0")
call writeln(f1,"z6 z0cbr1 r0"left(" ",75)"r1 r0z6 z0")
c1=c%2;c2=c1;jj=0;if c1+c2~=c then do;c1=c1+1;jj=1;end
do i=1 to c1;j=i+c2+jj;co="ca";if i/2=i%2 then co="cd"
parse var b.i n1""b1""ju;call CNUM(b1);a1=a
z="z6 z0r1cb r0 "co||right(n1,14)" uses "right(a1,9)" bytes."
if b.j~="" then do;parse var b.j n2""b2""ju;call CNUM(b2);a2=a
z=z||right(n2,14)" uses "right(a2,9)" bytes. r1cb r0z6 z0";end
else do;z=z||left(" ",38)"r1cb r0z6 z0";end;call writeln(f1,z)
end i
call writeln(f1,"z6 z0cbr1 r0"left(" ",75)"r1 r0z6 z0")
call writeln(f1,"z6c4"center("FIDO-Net Byte Size List Updated Daily",79)"z0")
call close(f1)
se "*0"ff"basesizes}";exit
CNUM: /* Comma Number Parser (Place commas inside numbers) */
parse arg a;b=length(a);if b=4 then a=insert(",",a,1,1)
if b=5 then a=insert(",",a,2,1);if b=6 then a=insert(",",a,3,1)
if b=7 then do;a=insert(",",a,1,1);a=insert(",",a,5,1);end
return
SYNTAX:;ERROR:;IOERR:;e1=' c9Errorcf: ca'rc' cf(ca'errortext(rc)'cf)';e2=' c9Linecf: ce'left(sigl,4)'c9Filecf:'
gu 1311992;a=result;gu 1311960;b=result;c='cb"ce'a||b'cb"';e2=e2' 'c;tr e1;tr e2;logentry e1;logentry e2;e=sourceline(sigl)
do while e~='';e3='c9Sourcecf: cd'left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush;exit
/** Last Edited: 27-Jan-95 ************************************************\
\****************************************** FRONTIERS BBS (716)/823-9892 **/